home *** CD-ROM | disk | FTP | other *** search
/ Canon Creative 3 / Canon Creative 3 - Disc 2.iso / designe / DE.DIR / 00016.ls < prev    next >
Encoding:
Text File  |  1997-05-08  |  1.3 KB  |  61 lines

  1. on playAmbientSound
  2.   global gAmbientSound, gOverrideSoundPlaying
  3.   if gAmbientSound = #null then
  4.     exit
  5.   end if
  6.   if soundBusy(2) then
  7.     exit
  8.   end if
  9.   set gOverrideSoundPlaying to 0
  10.   sound playFile 2, gAmbientSound
  11. end
  12.  
  13. on setAmbientSound soundFileName
  14.   global gAmbientSoundName, gAmbientSound, gSoundPath, gOverrideSoundPlaying, gSoundOn
  15.   set gOverrideSoundPlaying to 0
  16.   if soundFileName = #null then
  17.     if soundBusy(2) then
  18.       sound stop 2
  19.     end if
  20.     set gAmbientSound to #null
  21.     exit
  22.   end if
  23.   set gAmbientSoundName to soundFileName
  24.   if gSoundOn then
  25.     set ss to fixPath(gSoundPath & soundFileName)
  26.     if ss <> gAmbientSound then
  27.       sound stop 2
  28.       set gAmbientSound to ss
  29.       sound playFile 2, ss
  30.     end if
  31.   end if
  32. end
  33.  
  34. on playOverrideSound soundFileName
  35.   global gSoundPath, gOverrideSoundPlaying
  36.   set ss to fixPath(gSoundPath & soundFileName)
  37.   sound stop 2
  38.   sound playFile 2, ss
  39.   set gOverrideSoundPlaying to 1
  40. end
  41.  
  42. on stopOverrideSound
  43.   global gOverrideSoundPlaying
  44.   if gOverrideSoundPlaying then
  45.     sound stop 2
  46.     set gOverrideSoundPlaying to 0
  47.   end if
  48. end
  49.  
  50. on fixPath str
  51.   if the machineType = 256 then
  52.     set ll to length(str)
  53.     repeat with i = 3 to ll
  54.       if char i of str = ":" then
  55.         put "\" into char i of str
  56.       end if
  57.     end repeat
  58.   end if
  59.   return str
  60. end
  61.